<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>filter_helloworld</title>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
</head>
<body style="height: 1500px;">
    <div id="app">
        <div><input v-model="hello"></div>
        <p>{{ hello | capitalize }}</p>
    </div>
    <script>
        new Vue({
            el: '#app',
            filters: {
                capitalize: function(value){
                    if(!value) return '';
                    value = value.toString();
                    return value.charAt(0).toUpperCase() + value.slice(1);
                }
            },
            data: {
                hello: ''
            }
        });
    </script>
</body>
</html>
